<?php use_stylesheets_for_form($form) ?>
<?php use_javascripts_for_form($form) ?>

<?php if($form->getObject()->isNew()) : ?>
    <?php if(isset($lot)) : ?>
        <form action="<?php echo url_for('commentaire/createCommentaireLot?id_lot='.$lot->getIdLot()) ?>" method="post" <?php $form->isMultipart() and print 'enctype="multipart/form-data" ' ?>>
    <?php elseif(isset($echantillon)) : ?>
         <form action="<?php echo url_for('commentaire/createCommentaireEchantillon?id_echantillon='.$echantillon->getIdEchantillon()) ?>" method="post" <?php $form->isMultipart() and print 'enctype="multipart/form-data" ' ?>>   
    <?php elseif(isset($traitement)) : ?>
         <form action="<?php echo url_for('commentaire/createCommentaireTraitement?id_traitement='.$traitement->getIdTraitement()) ?>" method="post" <?php $form->isMultipart() and print 'enctype="multipart/form-data" ' ?>> 
    <?php elseif(isset($mesure)) : ?>
         <form action="<?php echo url_for('commentaire/createCommentaireMesure?id_mesure='.$mesure->getIdMesure()) ?>" method="post" <?php $form->isMultipart() and print 'enctype="multipart/form-data" ' ?>> 
    <?php endif; ?>
<?php else : ?>
    <form action="<?php echo url_for('commentaire/update?id_commentaire='.$form->getObject()->getIdCommentaire()) ?>" method="post" <?php $form->isMultipart() and print 'enctype="multipart/form-data" ' ?>>
    <input type="hidden" name="sf_method" value="put" />
<?php endif; ?>
  <table class="formulaire">
    <tfoot>
      <tr>
        <td colspan="2">
          <?php echo $form->renderHiddenFields(false) ?>
          <?php if (!$form->getObject()->isNew()): ?>
            &nbsp;
          <?php endif; ?>
          <input type="submit" value="Enregistrer" class="submit" />
          <?php if(isset($lot)) : ?>
            <a href="<?php echo url_for("lot/show?id_lot=".$lot->getIdLot()) ?>" class="submit">Annuler</a>
          <?php elseif(isset($echantillon)) : ?>
            <a href="<?php echo url_for("echantillon/show?id_echantillon=".$echantillon->getIdEchantillon()) ?>" class="submit">Annuler</a>
          <?php elseif(isset($traitement)) : ?>
            <a href="<?php echo url_for("traitement/show?id_traitement=".$traitement->getIdTraitement()) ?>" class="submit">Annuler</a>
          <?php elseif(isset($mesure)) : ?>
            <a href="<?php echo url_for("mesure/show?id_mesure=".$mesure->getIdMesure()) ?>" class="submit">Annuler</a>
          <?php endif; ?>
        </td>
      </tr>
    </tfoot>
    <tbody>
      <?php echo $form->renderGlobalErrors() ?>
        <?php echo $form ?>
    </tbody>
  </table>
</form>
